//
//  TPBaseViewController.m
//  
//
//  Created by leonardo on 2017/2/20.
//
//

#import "TPBaseViewController.h"

@interface TPBaseViewController ()
PRO_S NSMutableArray <UIViewController *> * willPresentVCs;
@end

@implementation TPBaseViewController

- (void)viewDidLoad {
    DDLogVerbose(@"%@ viewDidLoad" , NSStringFromClass(self.class));

    [super viewDidLoad];
    self.view.backgroundColor = COLOUR_BACKGROUND;
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated{

    DDLogVerbose(@"%@ viewWillAppear" , NSStringFromClass(self.class));
    [super viewWillAppear:animated];
}

-(void)viewDidAppear:(BOOL)animated{
    DDLogVerbose(@"%@ viewDidAppear" , NSStringFromClass(self.class));
    [super viewDidAppear:animated];
}

-(void)viewWillDisappear:(BOOL)animated{
    DDLogVerbose(@"%@ viewWillDisappear" , NSStringFromClass(self.class));
    [super viewWillDisappear:animated];
}

-(void)viewDidDisappear:(BOOL)animated{
    DDLogVerbose(@"%@ viewDidDisappear" , NSStringFromClass(self.class));
    [super viewDidAppear:animated];

}
//-(void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion{
//    
//    if (self.presentedViewController) {
//        DDLogDebug( @"these is a presented VC exist");
//        [_willPresentVCs addObject:viewControllerToPresent];
//        showPresentedVC_group = dispatch_group_create();
//        dispatch_group_enter(showPresentedVC_group);
//        dispatch_group_notify(showPresentedVC_group, dispatch_get_main_queue(), ^{
//            [super presentViewController:[_willPresentVCs firstObject] animated:flag completion:completion];
//        });
//    }else{
//        DDLogDebug( @"will present a vc");
//        [super presentViewController:viewControllerToPresent animated:flag completion:completion];
//    }
//}
- (void)dealloc{
    DDLogVerbose(@"%@ dealloc" , NSStringFromClass(self.class));

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
